Skip to content

CALM CLI access to CalmHub - cleanup of tests and tighten conditions when CalmHub accesses are made#1784

Merged
rocketstack-matt merged 5 commits intofinos:mainfrom
markscott-ms:1778-calmhubauth
Nov 8, 2025
Merged

CALM CLI access to CalmHub - cleanup of tests and tighten conditions when CalmHub accesses are made#1784
rocketstack-matt merged 5 commits intofinos:mainfrom
markscott-ms:1778-calmhubauth

Conversation

@markscott-ms
Copy link
Contributor

@markscott-ms markscott-ms commented Nov 7, 2025

Description

  1. Clean up of CalmHub related document loader tests in CALM CLI - some invalid DocumentLoaderOptions and method arguments were present in the tests.
  2. Restricted CalmHubDocumentLoader to only attempt loading when the protocol is calm:. Currently the path from any URL formatted document locator is valid, with the expectation that the path can be added to the CalmHub base URL.

Assuming CalmHub base URL is https://calmhub.finos.org/calm/:

  • Old behaviour:
    • URL: http://example.com/my-first-picture.png => CalmHubDocumentLoader attempts to load https://calmhub.finos.org/calm/my-first-picture.png.
    • URL: ftp:my-first-picture.png => CalmHubDocumentLoader attempts to load https://calmhub.finos.org/calm/my-first-picture.png.
    • URL: notcalm:my-first-picture.png => CalmHubDocumentLoader attempts to load https://calmhub.finos.org/calm/my-first-picture.png.
  • Example of new behaviour:
    • URL: http://example.com/my-first-picture.png => CalmHubDocumentLoader does not attempt to load anything.
    • URL: ftp:my-first-picture.png => CalmHubDocumentLoader does not attempt to load anything.
    • URL: notcalm:my-first-picture.png => CalmHubDocumentLoader does not attempt to load anything.
    • URL: calm:my-first-picture.png => CalmHubDocumentLoader attempts to load https://calmhub.finos.org/calm/my-first-picture.png.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Shared (shared/)
  • CALM Widgets (calm-widgets/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • Documentation (docs/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces protocol validation for the CalmHub document loader by adding a custom calm: protocol. The changes enable the system to differentiate between CalmHub documents and other document sources, improving the multi-strategy document loading behavior.

  • Added CALM_HUB_PROTO constant to define the calm: protocol
  • Implemented protocol validation in CalmHubDocumentLoader to only process documents with the calm: protocol
  • Updated tests to use the new calm: protocol format and removed deprecated loadMode parameter

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
shared/src/document-loader/document-loader.ts Adds CALM_HUB_PROTO constant to define the custom protocol identifier
shared/src/document-loader/document-loader.spec.ts Removes deprecated loadMode parameter from test calls to buildDocumentLoader
shared/src/document-loader/calmhub-document-loader.ts Implements protocol validation to ensure only calm: protocol documents are processed
shared/src/document-loader/calmhub-document-loader.spec.ts Updates test URLs to use calm: protocol and adds test coverage for protocol validation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rocketstack-matt rocketstack-matt merged commit 0444f73 into finos:main Nov 8, 2025
12 checks passed
pmerrison pushed a commit to pmerrison/architecture-as-code that referenced this pull request Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants